using System;
using System.Collections;
using System.IO;
using System.Management.Automation.Provider;

namespace Nivot.PowerShell.WindowsMobile
{
    internal class WindowsMobileFile : StoreItem<CEFile>, IContentReader
    {
        private const string ParamLocal = "Local";

        internal WindowsMobileFile(CEFile file) : base(file)
        {
        }

        public override string ChildName
        {
            get { return NativeObject.Name; }
        }

        public override bool IsContainer
        {
            get { return false; }
        }

        public override StoreItemOptions ItemOptions
        {
            get { return StoreItemOptions.ShouldPipeItem | StoreItemOptions.ShouldTabComplete; }
        }

        #region IContentReader Members

        public IList Read(long readCount)
        {
            throw new NotImplementedException();
        }

        public void Seek(long offset, SeekOrigin origin)
        {
            throw new NotImplementedException();
        }

        public void Close()
        {
            throw new NotImplementedException();
        }

        #endregion

        public override void InvokeItem()
        {
            NativeObject.InvokeItem(this.IsSwitchParameterSet(ParamLocal) ?? false);
        }
    }
}